// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.carbondioxide.service.impl;

import java.util.stream.Collector;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.orange.boot.environment.entity.EnvironmentData;
import java.util.List;
import org.springframework.stereotype.Service;
import com.orange.boot.carbondioxide.service.EnvironmentData6Service;
import com.orange.boot.carbondioxide.entity.EnvironmentData6;
import com.orange.boot.carbondioxide.mapper.EnvironmentData6Mapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@Service
public class EnvironmentData6ServiceImpl extends ServiceImpl<EnvironmentData6Mapper, EnvironmentData6> implements EnvironmentData6Service
{
    public List<EnvironmentData> getEnvironmentalData(String code) {
        QueryWrapper<EnvironmentData6> queryWrapper = (QueryWrapper)((QueryWrapper)((QueryWrapper)(new QueryWrapper()).eq("code", code)).orderByDesc("gmt_create")).last("LIMIT 10");
        List<EnvironmentData6> environmentData6s = ((EnvironmentData6Mapper)this.baseMapper).selectList(queryWrapper);
        List<EnvironmentData> dataList = (List)environmentData6s.stream().map((tar) -> {
            return new EnvironmentData(tar.getCode(), tar.getValue(), tar.getUnit(), tar.getGmtCreate());
        }).collect(Collectors.toList());
        return dataList.size() != 0 ? dataList : null;
    }
}
